<template>

  <view class="" style="background-color: #eee;height: 100vh;box-sizing: border-box;padding: 2rem 1rem;overflow: auto;">
    <view class="tonghi" v-for="(item, index) in indexList" :key="index" >
      <view class="timxians">
        题目：	{{ item.questionTitle }}
      </view>
      <view class="timxians1">发布人： {{ item.createBy }}</view>
      <view class="timxians2">发布时间：{{ item.createTime }}</view>
      <view class="buttom" @click="handleClick1(item)">查看</view>
    </view>
    <u-toast ref="uToast"></u-toast>

  </view>
</template>

<script>
import {
  baseUrl
} from '../../utils/config.js';
export default {
  data() {
    return {
      indexList: [],

    }
  },
  onLoad() {
    this.loadmore()
  },
  methods: {
    scrolltolower() {
      this.loadmore()
    },
    loadmore() {
      var thas = this
      uni.request({
        url: `${baseUrl}/wechat/InfoQuestionNaireLog/list`,
        method: 'GET',
        header: { taken: uni.getStorageSync('ykt_openId') },
        success(res) {
          thas.indexList = res.data.data
        },

      });

    },
    handleClick1(row) {
      console.log(row,"322")
      if (row.sumScore!=null) {
        this.$refs.uToast.show({
          type: 'default',
          message: "已提交，请选择其他题目进行答题",
        })
        return
      }
      uni.navigateTo({
        url: `/pages/special/xuexiS?id=${row.id}`
      });
    }
  },
}
</script>

<style scoped lang="scss">
.tonghi {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #333;
  border-bottom: 1px solid #eee;
  padding: 10px 10px;
  background-color: #fff;
  border-radius: 0.4rem;
  margin-bottom: 2rem;
  border: 1px solid #fff;
  padding: 1rem 1rem;
  position: relative;
}

.timxians {
  font-size: 16px;
  font-weight: 600;
  width: 100%;

}

.timxians1 {
  font-size: 16px;
  width: 100%;

}

.timxians2 {
  font-size: 14px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.buttom{
  position: absolute;
  background-color: #2979ff;
  color: #fff;
  border-radius: 0.2rem;
  padding: 5px 10px;
  right: 10px;
  bottom: 10px;
}
</style>